<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>

<div class="block">
    
    <div class="block_head">
        <div class="bheadl"></div>
        <div class="bheadr"></div>
        <logic:lessThan name="locationForm" property="locationID" value="1">
            <h2>Add Land Plan</h2>
        </logic:lessThan>
        <logic:greaterThan name="locationForm" property="locationID" value="0">
            <h2>Edit Location "<bean:write name="locationForm" property="locationName"/>"</h2>
        </logic:greaterThan>
    </div>
    <!-- .block_head ends -->
    
    <div class="block_content clearfix">
        <html:form styleClass="validate-form" styleId="locationForm" action="admin/location.do" method="post">
            
            <logic:notEmpty name="errorMessages" >
                <div class="message errormsg">
                    <logic:iterate id="message" name="errorMessages">
                        <p><bean:write name="message"/></p>
                    </logic:iterate>
                </div>
            </logic:notEmpty>
            <logic:notEmpty name="successMessages" >
                <div class="message success">
                    <logic:iterate id="message" name="successMessages">
                        <p><bean:write name="message"/></p>
                    </logic:iterate>
                </div>
            </logic:notEmpty>
            <p>
                <html:hidden property="locationID" />
                <label for="locationName">Location Name:</label><span class="required">*</span><br/>
                <html:text styleId="locationName" styleClass="text medium required" property="locationName"/>
            </p>
            <p>
                <label for="presentCost">Present Cost:</label><span class="required">*</span><br/>
                <html:text styleId="presentCost" styleClass="text small required number" property="presentCost"/>
                <label for="presentCost" class="note">U.S. dollars / sq. foot</label>
                <label for="presentCost" class="error" generated="true" style="display:none;"></label>
            </p>
            
            <hr/>
            
            <p>
                <html:submit property="action" value="Save" styleClass="submit small"/>    
                <logic:greaterThan name="locationForm" property="locationID" value="0">
                    <html:link styleClass="submit small red confirm-button" action="/admin/locationListing.do?action=delete" paramId="locationID" paramName="locationForm" paramProperty="locationID">
                        Delete
                    </html:link>
                </logic:greaterThan>
                <html:link action="/admin/locationListing.do" styleClass="submit small gray">Cancel</html:link>
            </p>
            
            
        </div>
        <!-- .block_content ends -->
    </html:form>
        
    <div class="bendl"></div>
    <div class="bendr"></div>
    
</div>
<!-- .block ends -->
